package com.cloud.test;

import com.cloud.service.HelloService;
import com.sun.tools.javac.util.ServiceLoader;

/**
 * @author stevejson
 */
public class JavaSpiMain {
    public static void main(String[] args) {
        final ServiceLoader<HelloService> helloServices = ServiceLoader.load(HelloService.class);
        for (HelloService helloService : helloServices) {
            String s = helloService.sayHello();
            System.out.println(s);
        }
    }
}
